package com.deliccio.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.deliccio.connect.DAO;
import com.deliccio.dao.ColumnaDAO;
import com.deliccio.entitys.Columna;
import com.deliccio.entitys.Grid;

@Repository("ColumnaDAO")
public class ColumaDAOImpl extends DAO<Columna> implements ColumnaDAO{

	@Override
	public List<Columna> obtenerporGrid(Grid g){
		sqlQuery=" select new Columna(c.id,c.nombre,c.codigo,c.visible,c.titulo,c.ancho,c.mapping) from Columna c where c.grid.id=:id ";
		q=em.createQuery(sqlQuery);
		q.setParameter("id",g.getId());		
		return q.getResultList();
	}
	
}
